<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .nav {
            width: 200px;
            height: 30px;
            margin: 0 auto;
            position: relative;
            background-color: antiquewhite;
        }

        li {
            width: 40px;
            height: 28px;
            float: left;
            list-style: none;
        }

        .lii li {
            background-color: aqua;
        }
    </style>
</head>

<body>
    <ul class="nav">
        <li>
            <a href="#">微博</a>
            <ul class="lii">
                <li>1</li>
                <li>2</li>
                <li>3</li>
            </ul>
        </li>
        <li>
            <a
                href="https://www.bilibili.com/video/BV1Sy4y1C7ha?p=231&spm_id_from=pageDriver&vd_source=480c28921b1b6c12cb33e4a6f0a94947">视频</a>
            <ul>
                <li>3</li>
                <li>2</li>
                <li>1</li>
            </ul>
        </li>
        <li>
            <a href="#">微博</a>
            <ul>
                <li>9</li>
                <li>6</li>
                <li>6</li>
            </ul>
        </li>
        <li>
            <a href="#">微博</a>
            <ul>
                <li>5</li>
                <li>7</li>
                <li>3</li>
            </ul>
        </li>
    </ul>
    <script>
        let nav = document.querySelector('.nav');
        let lis = nav.children;
        for (let i = 0; i < lis.length; i++) {
            lis[i].onmouseover = function () {
                this.children[1].style.display = 'block';
            }
            lis[i].onmouseout = function () {
                this.children[1].style.display = 'none';
            }
        }
    </script>
</body>

</html>